home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / eue10.zip / REGISTER.PRG < prev    next >
Text File  |  1992-12-29  |  12KB  |  432 lines

  1. *Extended User Editor (register) - version 1.0 12/30/92 (c) 1992 James E. Swarm
  2. *
  3. *This version of the program is fully working, and is to be considered
  4. *shareware.  If you use this software I ask that you register it with
  5. *a donation to my BBS.  Registered users will receive full tdbs source
  6. *(available for download) for both the USERLIST and USEREDIT program.  
  7. *A donation is $20.00 or higher... thats up to you, but the better 
  8. *responce I get, the more I will update the programs.
  9. *
  10. *Please send all donations to:
  11. *
  12. *James E. Swarm
  13. *
  14. *P.O. Box 361093
  15. *Strongsville, Ohio 44136
  16. *BBS (216)237-4980
  17. *
  18. * WARRNING THIS CODE CHANGES USERFLAGS A1 1,2,3 and 8!!!
  19. *
  20. SET EXCLUSIVE OFF
  21. SET ESCAPE OFF
  22. public elite,age,recomend,comp,baud,add1,add2,city,state,zip,country,phone,location,realn,user 
  23. public f_add1,f_add2,f_city,f_state,f_zip,f_country,f_phone,f_location,f_realn,f_user,f_newubyte,f_newdbyte 
  24. public f_age,f_callmday,f_mday,f_ratiou,f_ratiod,f_timebank,f_modify
  25. public sname,answer,handle,cnumber,counter
  26. clear
  27. name = ""
  28. ? ""
  29. ? "Please answer the following registration questions."
  30. ? ""
  31. do prname
  32. do pphone
  33. do padd1
  34. do padd2
  35. do pcity
  36. do pstate
  37. do pzip
  38. do pcountry
  39. do pbday
  40. do pcomputer
  41. do precomend
  42. do pfiles
  43. do display
  44. DO WHILE .T.
  45.         DO getanser WITH "YN",.T.,"N"
  46.         DO CASE
  47.         CASE answer = "Y"
  48.                 userinfo = (((((((((((((add1+chr(0))+add2)+chr(0))+city)+chr(0))+state)+chr(0))+zip)+chr(0))+phone)+chr(0))+country)+chr(0))
  49.                 pokedummy = ulpoke(256,6,userinfo,128)
  50.                 use "useredit"
  51.                 set index to "username"
  52.                 name = uname()
  53.                 seek name
  54.                 if .not. found()
  55.                         append blank
  56.                 endif
  57.                 replace f_user with uname()
  58.                 replace f_realn with realn
  59.                 dummy=ulreplace(unotes,realn)
  60.                 replace f_location with ulocation()
  61.                 replace f_phone with phone
  62.                 replace f_add1 with add1
  63.                 replace f_add2 with add2
  64.                 replace f_city with city
  65.                 replace f_state with state
  66.                 replace f_zip with zip
  67.                 replace f_country with country
  68.                 replace f_age with age
  69.                 replace f_comp with comp
  70.                 replace f_recomend with recomend
  71.                 replace f_elite with elite
  72.                 replace f_newubyte with 0
  73.                 replace f_newdbyte with 0
  74.                 replace f_modify with .F.        
  75.                 replace f_ratiou with 1
  76.                 replace f_ratiod with 1
  77.                 use
  78.                 a1 = uauth(1)
  79.                 a1_off = stuff(a1,1,1,".")
  80.                 set = ULREPLACE(UAUTH,1,a1_off)
  81.                 exit
  82.         CASE answer = "N"
  83.                 do edisplay
  84.                 DO WHILE .T.
  85.                         DO getanser WITH "ABCDEFGHIJK",.T.,"Q"
  86.                         ? ""
  87.                         DO CASE
  88.                         CASE answer = "A"
  89.                                 do prname
  90.                                 do edisplay
  91.                                 loop
  92.                         CASE answer = "B"
  93.                                 do pphone
  94.                                 do edisplay
  95.                                 loop
  96.                         CASE answer = "C"
  97.                                 do padd1
  98.                                 do padd2
  99.                                 do edisplay
  100.                                 loop
  101.                         CASE answer = "D"
  102.                                 do pcity
  103.                                 do edisplay
  104.                                 loop
  105.                         CASE answer = "E"
  106.                                 do pstate
  107.                                 do edisplay
  108.                                 loop
  109.                         CASE answer = "F"
  110.                                 do pzip
  111.                                 do edisplay
  112.                                 loop
  113.                         CASE answer = "G"
  114.                                 do pcountry
  115.                                 do edisplay
  116.                                 loop
  117.                         CASE answer = "H"
  118.                                 do pbday
  119.                                 do edisplay
  120.                                 loop
  121.                         CASE answer = "I"
  122.                                 do pcomputer
  123.                                 do edisplay
  124.                                 loop
  125.                         CASE answer = "J"
  126.                                 do precomend
  127.                                 do edisplay
  128.                                 loop
  129.                         CASE answer = "K"
  130.                                 do pfiles
  131.                                 do edisplay
  132.                                 loop
  133.                         CASE answer = "Q"
  134.                                 do display
  135.                                 exit
  136.                         ENDCASE
  137.                 ENDDO
  138.         ENDCASE
  139. ENDDO
  140. dotbbs type 1 optdata "notice.txt/nk"
  141. ? ""
  142. ? "Do you AGREE to all the above infromation (Y/n)? "
  143. DO WHILE .T.
  144.         DO getanser WITH "YN",.T.,"Y"
  145.         DO CASE
  146.         CASE answer = "Y"
  147.                 a1 = uauth(1)
  148.                 a1_off = stuff(a1,2,1,".")
  149.                 set = ULREPLACE(UAUTH,1,a1_off)
  150.                 exit
  151.         CASE answer = "N"
  152.                 exit
  153.         ENDCASE
  154. ENDDO
  155. dotbbs type 1 optdata "yesno.txt/nk"
  156. ? ""
  157. ? "Please answer YES or NO (y/N)? "
  158. DO WHILE .T.
  159.         DO getanser WITH "YN",.T.,"N"
  160.         DO CASE
  161.         CASE answer = "Y"
  162.                 exit
  163.         CASE answer = "N"
  164.                 a1 = uauth(1)
  165.                 a1_off = stuff(a1,3,1,".")
  166.                 set = ULREPLACE(UAUTH,1,a1_off)
  167.                 exit
  168.         ENDCASE
  169. ENDDO
  170. quit
  171.  
  172. PROCEDURE getanser
  173.  
  174. PARAMETER srchstrng, default, def_val
  175.  
  176. DO WHILE .T.
  177.    key = INKEY(0)
  178.    IF key = 13 .AND. default
  179.       answer = def_val
  180.       ?? answer
  181.       EXIT
  182.    ENDIF
  183.    answer = UPPER(CHR(key))
  184.    IF .NOT. answer $ srchstrng
  185.       LOOP
  186.    ENDIF
  187.    ?? answer
  188.    EXIT
  189. ENDDO
  190. RETURN
  191.  
  192. PROCEDURE display
  193.  
  194. clear
  195. ? "Please verify the following information."
  196. ? ""
  197. ? "Name        : " uname()
  198. ? "From        : " ulocation() 
  199. ? "Real Name   : " realn
  200. ? "Phone       : " phone
  201. ? "Address     : " add1
  202. ? "            : " add2
  203. ? "City        : " city
  204. ? "State       : " state
  205. ? "Zip         : " zip
  206. ? "Country     : " country
  207. ? "Age         : " age
  208. ? "C.Type      : " comp
  209. ? "Recomend    : " recomend
  210. ? "Files       : " elite
  211. ? ""
  212. ? "Is this information correct (y/N)? "
  213. return
  214.  
  215. PROCEDURE edisplay
  216.  
  217. clear
  218. ? "Please verify the following information."
  219. ? ""
  220. ? "Name        : " uname()
  221. ? "From        : " ulocation() 
  222. ? "Real Name(A): " realn
  223. ? "Phone    (B): " phone
  224. ? "Address  (C): " add1
  225. ? "            : " add2
  226. ? "City     (D): " city
  227. ? "State    (E): " state
  228. ? "Zip      (F): " zip
  229. ? "Country  (G): " country
  230. ? "Age      (H): " age
  231. ? "C.Type   (I): " comp
  232. ? "Recomend (J): " recomend
  233. ? "Files    (K): " elite
  234. ? ""
  235. ? "Please enter the letter of the line to edit (ENTER to exit). "
  236. ? ": "
  237. return
  238.  
  239.  
  240. PROCEDURE replace
  241.  
  242. replace f_user with user
  243. replace f_realn with realn
  244. replace f_location with location
  245. replace f_phone with phone
  246. replace f_add1 with add1
  247. replace f_add2 with add2
  248. replace f_city with city
  249. replace f_state with state
  250. replace f_zip with zip
  251. replace f_country with country
  252. return
  253.  
  254. PROCEDURE prname
  255. do while .t.
  256.         ? "What is your FULL real name?"
  257.         accept ": " to realn
  258.         ? ""
  259.         lenght = len(realn)
  260.         if lenght < 3
  261.                 ? "Invalid data, please re-enter."
  262.                 ? ""
  263.                 loop
  264.         endif
  265.         realn = left(realn,30)
  266.         exit
  267. enddo
  268. return
  269. PROCEDURE pphone
  270. do while .t.
  271.         ? "What is your VOICE phone number (XXX-XXX-XXXX)?"
  272.         accept ": " to phone
  273.         ? ""
  274.         length = len(phone)
  275.         if length < 12 .or. length > 12
  276.                 ? "Invalid data, please re-enter."
  277.                 ? ""
  278.                 loop
  279.         endif
  280.         phone = left(phone,12)
  281.         exit
  282. enddo
  283. return
  284. PROCEDURE padd1
  285. do while .t.
  286.         ? "What is your address (Street Address Only, you have two lines)?"
  287.         accept ": " to add1
  288.         lenght = len(add1)
  289.         if lenght < 2
  290.                 ? ""
  291.                 ? "Invalid data, please re-enter."
  292.                 ? ""
  293.                 loop
  294.         endif
  295.         add1 = left(add1,31)
  296.         exit
  297. enddo
  298. return
  299. PROCEDURE padd2
  300. do while .t.
  301.         accept ": " to add2
  302.         ? ""
  303.         add2 = left(add2,31)
  304.         exit
  305. enddo
  306. return
  307. PROCEDURE pcity
  308. do while .t.
  309.         ? "What City/Province do you live in?"
  310.         accept ": " to  city
  311.         ? ""
  312.         lenght = len(city)
  313.         if lenght < 2
  314.                 ? "Invalid data, please re-enter."
  315.                 ? ""
  316.                 loop
  317.         endif
  318.         city = left(city,20)
  319.         exit
  320. enddo
  321. return
  322. PROCEDURE pstate
  323. do while .t.
  324.         ? "What State do you live inn (2 letter)?"
  325.         accept ": " to state
  326.         ? ""
  327.         lenght = len(state)
  328.         if lenght < 2
  329.                 ? "Invalid data, please re-enter."
  330.                 ? ""
  331.                 loop
  332.         endif
  333.         state = left(state,2)
  334.         if .not. isstate(state)
  335.                 ? "Invalid data, please re-enter."
  336.                 ? ""
  337.                 loop
  338.         endif
  339.         exit
  340. enddo
  341. return
  342. PROCEDURE pzip
  343. do while .t.
  344.         ? "What is your Zip/Postal Code?"
  345.         accept ": " to zip
  346.         ? ""
  347.         lenght = len(zip)
  348.         if lenght < 5
  349.                 ? "Invalid data, please re-enter."
  350.                 ? ""
  351.                 loop
  352.         endif
  353.         zip = left(zip,10)
  354.         exit
  355. enddo
  356. return
  357. PROCEDURE pcountry
  358. do while .t.
  359.         ? "What Country do you live in (USA, CANADA etc.)?"
  360.         accept ": " to country
  361.         ? ""
  362.         lenght = len(country)
  363.         if lenght < 2
  364.                 ? "Invalid data, please re-enter."
  365.                 ? ""
  366.                 loop
  367.         endif
  368.         country = left(country,10)
  369.         exit
  370. enddo
  371. return
  372. PROCEDURE pbday
  373. do while .t.
  374.         ? "What is your birth date (MM/DD/YY)?"
  375.         accept ": " to age
  376.         ? ""
  377.         lenght = len(age)
  378.         if lenght < 8 .or. lenght > 8
  379.                 ? "Invalid data, please re-enter."
  380.                 ? ""
  381.                 loop
  382.         endif
  383.         age = ctod(age)
  384.         exit
  385. enddo
  386. return
  387. PROCEDURE pcomputer
  388. do while .t.
  389.         ? "What type of computer do you have (ex. 386SX, Atari ST)?"
  390.         accept ": " to comp
  391.         ? ""
  392.         lenght = len(comp)
  393.         if lenght < 2
  394.                 ? "Invalid data, please re-enter."
  395.                 ? ""
  396.                 loop
  397.         endif
  398.         comp = left(comp,20)
  399.         exit
  400. enddo
  401. return
  402. PROCEDURE precomend
  403. do while .t.
  404.         ? "Who Recomended you to this system?"
  405.         accept ": " to recomend
  406.         ? ""
  407.         lenght = len(recomend)
  408.         if lenght < 2
  409.                 ? "Invalid data, please re-enter."
  410.                 ? ""
  411.                 loop
  412.         endif
  413.         recomend = left(recomend,30)
  414.         exit
  415. enddo
  416. return
  417. PROCEDURE pfiles
  418. do while .t.
  419.         ? "What are your latest files?"
  420.         accept ": " to elite
  421.         ? ""
  422.         lenght = len(elite)
  423.         if lenght < 2
  424.                 ? "Invalid data, please re-enter."
  425.                 ? ""
  426.                 loop
  427.         endif
  428.         elite = left(elite,30)
  429.         exit
  430. enddo
  431. return
  432.